<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<fieldset class="layui-elem-field" th:fragment="free_charge_model" th:case="'free_charge_model'">
    <legend th:text="${type == 'create' ? '免搭伙费 - 信息新增' : '免搭伙费 - 信息更新'}"></legend>
    <div class="layui-field-box">
        <!--post方式提交-->
        <form class="layui-form" th:method="${type == 'create' ? 'get' : 'post'}" th:action="@{${req_url}}">
            <input type="hidden" name="freeId" th:if="${freeCharge != null}" th:value="${freeCharge.freeId}">
            <div class="layui-form-item">
                <label class="layui-form-label">持卡片类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="freeType" value="1" title="临时卡" th:checked="${freeCharge != null} ? ${freeCharge.freeType == 1}">
                    <input type="radio" name="freeType" value="2" title="钱包卡" th:checked="${freeCharge != null} ? ${freeCharge.freeType == 2}">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">卡号</label>
                <div class="layui-input-block">
                    <input type="text"  name="freeNumber" th:value="${freeCharge != null} ? ${freeCharge.freeNumber}" required  lay-verify="required" placeholder="请输入卡号" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用卡情况</label>
                <div class="layui-input-block">
                    <input type="radio" name="freeSign" value="0" title="新卡" th:checked="${freeCharge != null} ? ${freeCharge.freeSign == 0}">
                    <input type="radio" name="freeSign" value="1" title="续卡" th:checked="${freeCharge != null} ? ${freeCharge.freeSign == 1}">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">员工</label>
                <div class="layui-input-block">
                    <select name="empId" required  lay-verify="required" placeholder="请选择员工">
                        <option th:each="employee:${employees}" th:selected="${freeCharge != null && freeCharge.empId == employee.empId} ? 'selected'" th:value="${employee.empId}">[[${employee.empName}]]</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" type="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>

        </form>


    </div>
</fieldset>
</body>
</html>